package cn.xxm.ff.log.core.dto;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * Created by xuxiaoming005 on 2018-08-31.
 */
@Data
@AllArgsConstructor
public class CustomDesensitizeType {
    private String type;
    private int startIndex;
    private int endIndex;

    @Override
    public boolean equals(Object o) {
        if (this == o)
        {
            return true;
        }

        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }

        CustomDesensitizeType that = (CustomDesensitizeType) o;

        if (startIndex != that.startIndex) {
            return false;
        }
        if (endIndex != that.endIndex) {
            return false;
        }
        return type != null ? type.equals(that.type) : that.type == null;
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + startIndex;
        result = 31 * result + endIndex;
        return result;
    }
}
